/*
Copyright SecureKey Technologies Inc. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/
package context

import (
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/core"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/iam"
	"git.cloud.inspur.com/ichain/ichain-sdk-go/pkg/providers/ichain"
)

type Client ichain.ClientContext

type Providers interface {
	core.Providers
	iam.Providers
	ichain.Providers
}

// Local 封装了一个本地服务发现的客户端上下文
type Local interface {
	Client
	LocalDiscoveryService() ichain.DiscoveryService
}

// Chain 封装了一个本链服务的客户端上下文
type Chain interface {
	Client
	ChainService() ichain.ChainService
	ChainID() string
}

// ClientProvider 客户端上下文提供者
type ClientProvider func() (Client, error)

// LocalProvider 本地上下文提供者
type LocalProvider func() (Local, error)

// ChainProvider 链上下文提供者
type ChainProvider func() (Chain, error)
